package chapter7;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/7 17:32
 */
class Plate {
    public Plate(int i) {
        System.out.println("Plate constructor");
    }
}

class DinnerPlate extends Plate {
    public DinnerPlate(int i) {
        super(i);
        System.out.println("DinnerPlate constructor");
    }
}

class Utensil {
    public Utensil(int i) {
        System.out.println("Utensil constructor");
    }
}

class Spoon extends Utensil {
    public Spoon(int i) {
        super(i);
        System.out.println("Spoon constructor");
    }
}

class Fork extends Utensil {
    public Fork(int i) {
        super(i);
        System.out.println("Fork constructor");
    }
}

class Knife extends Utensil {
    public Knife(int i) {
        super(i);
        System.out.println("Knife constructor");
    }
}

class Cusotm {
    public Cusotm(int i) {
        System.out.println("Custom constructor");
    }
}

public class PlaceSetting extends Cusotm {

    private Spoon spoon;
    private Fork fork;
    private Knife knife;
    private DinnerPlate plate;

    public PlaceSetting(int i) {
        super(i);
        spoon = new Spoon(i + 2);
        knife = new Knife(i + 3);
        fork = new Fork(i + 4);
        plate = new DinnerPlate(i + 5);
        System.out.println("PlaceSetting constructor");
    }

    public static void main(String[] args) {
        PlaceSetting setting = new PlaceSetting(9);
    }
}
